171. Araxis Merge File Comparison Report

Produced by Araxis Merge on 2023-07-12 04:42:42 +0000. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

171.1 Files compared

#LocationFileLast Modified
12023-07-12 04:42:42 +0000
2Porto v4.0.6/Theme Files/Porto Theme/app/code/Smartwave/Filterproducts/view/frontend/templates/widgetowl_list.phtml2023-07-12 04:24:15 +0000

171.2 Comparison summary

DescriptionBetween
Files 1 and 2
Text BlocksLines
Unchanged00
Changed00
Inserted1506
Removed00

171.3 Comparison options

WhitespaceConsecutive whitespace is treated as a single space
Character caseDifferences in character case are significant
Line endingsDifferences in line endings (CR and LF characters) are ignored
CR/LF charactersNot shown in the comparison detail
Active line-pairing rules

171.4 Active regular expressions

No regular expressions were active.

171.5 Comparison detail

    1 <?php
    2 /**
    3  * Copyright © 2015 Magento. All rights reserved.
    4  * See COPYING.txt for license details.
    5  */
    6 use Magento\Framework\App\Action\Action;
    7 
    8 // @codingStandardsIgnoreFile
    9 ?>
    10 <?php
    11 /**
    12  * Product list template
    13  *
    14  * @var $block \Smartwave\Filterproducts\Block\
    15  */
    16 ?>
    17 <?php
    18 if ($exist = ($block->getProductCollection() && $block->getProductCollection()->getSize())) {
    19   $_productCollection = $block->getProductCollection()->getItems();
    20   $_helper = $this->helper('Magento\Catalog\Helper\Output');
    21   $_imagehelper = $this->helper('Magento\Catalog\Helper\Image');
    22   $_portohelper = $this->helper('Smartwave\Porto\Helper\Data');
    23   $_category_config = $_portohelper->getConfig('porto_settings/category');
    24   $_category_grid_config = $_portohelper->getConfig('porto_settings/category_grid');
    25   $_product_label_config = $this->helper('Smartwave\Porto\Helper\Data')->getConfig('porto_settings/product_label');
    26   $_lazyload = $this->helper('Smartwave\Porto\Helper\Data')->getConfig('porto_settings/optimization/lazyload');
    27   $extra_class = $this->getData("extra_class");
    28   // Daily deal Helper
    29   $_dailydealhelper =$this->helper('Smartwave\Dailydeals\Helper\Data');
    30 
    31   $aspect_ratio = $this->getData("aspect_ratio");
    32   if($aspect_ratio == null) {
    33       $aspect_ratio = $_category_config['aspect_ratio'];
    34   }
    35   $image_width = $this->getData("image_width");
    36   if(!$image_width) {
    37       $image_width = ($_category_config['ratio_width'])?$_category_config['ratio_width']:300;
    38   }
    39   $image_height = $this->getData("image_height");
    40   if($aspect_ratio)
    41       $image_height = $image_width;
    42   if(!$image_height) {
    43       $image_height = ($_category_config['ratio_height'])?$_category_config['ratio_height']:300;
    44   }
    45   $product_type = $this->getData("product_type");
    46   if($product_type == null) {
    47       $product_type = $_category_grid_config['product_type'];
    48   }
    49   if($product_type == null) {
    50       $product_type = 1;
    51   }
    52   $show_slide_nav = 'false';
    53   if($this->hasData("show_slide_nav")){
    54     $show_slide_nav = $this->getData("show_slide_nav") > 0 ? 'true': 'false';
    55   }
    56   $show_slide_page = 'false';
    57   if($this->hasData("show_slide_page")) {
    58     $show_slide_page = $this->getData("show_slide_page") > 0 ? 'true': 'false';
    59   }
    60   $enable_autoplay = 'false';
    61   if($this->hasData("enable_autoplay")) {
    62     $enable_autoplay = $this->getData("enable_autoplay") > 0 ? 'true': 'false';
    63   }
    64   $enable_slide_loop = 'false';
    65   if($this->hasData("enable_slide_loop")) {
    66     $enable_slide_loop = $this->getData("enable_slide_loop") > 0 ? 'true': 'false';
    67   }
    68   $desktop_slide_columns = '4';
    69   if($this->hasData("desktop_slide_columns")) {
    70     $desktop_slide_columns = $this->getData("desktop_slide_columns");
    71   }
    72   $tablet_slide_columns = '3';
    73   if($this->hasData("tablet_slide_columns")) {
    74     $tablet_slide_columns = $this->getData("tablet_slide_columns");
    75   }
    76   $mobile_slide_columns = '3';
    77   if($this->hasData("mobile_slide_columns")) {
    78     $mobile_slide_columns = $this->getData("mobile_slide_columns");
    79   }
    80 
    81   $id = $block->getData('page_var_name') . uniqid('', false);
    82 }
    83 ?>
    84 <?php if (!$exist): ?>
    85     <div class="message info empty"><div><?php echo __('We can\'t find products matching the selection.') ?></div></div>
    86 <?php else: ?>
    87     <?php
    88     $viewMode = 'grid';
    89     $image = 'category_page_grid';
    90     $hover_image = 'category_page_grid-hover';
    91     $showDescription = false;
    92     $templateType = \Magento\Catalog\Block\Product\ReviewRendererInterface::SHORT_VIEW;
    93     ?>
    94     <div id="porto-filter-products-<?= $id ?>" class="porto-products">
    95       <div class="slider-wrapper">
    96         <div class="products wrapper <?php echo $viewMode; ?> products-<?php echo $viewMode; ?> <?php if($product_type == 2): ?>no-padding divider-line<?php endif; ?> <?php if($product_type == 5 || $product_type == 6 || $product_type == 7 || $product_type == 8): ?>no-padding<?php endif; ?> <?php if($product_type == 6): ?>divider-line<?php endif; ?>">
    97             <?php $iterator = 1; ?>
    98             <div class="filterproducts products products-slider list items product-items owl-carousel <?php echo $extra_class;?>">
    99                 <?php /** @var $_product \Magento\Catalog\Model\Product */ ?>
    100                 <?php foreach ($_productCollection as $_product): ?>
    101                     <?php echo($iterator++ == 1) ? '<div class="item product product-item">' : '</div><div class="item product product-item">' ?>
    102                     <div class="product-item-info type<?php echo $product_type; ?>" data-container="product-grid">
    103                         <?php // Product Image ?>
    104                         <div class="product photo product-item-photo">
    105                             <a href="<?php echo $_product->getProductUrl() ?>" tabindex="-1">
    106                             <?php
    107                                 if($aspect_ratio)
    108                                     $productImage = $_imagehelper->init($_product, $image)->constrainOnly(FALSE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize($image_width);
    109                                 else
    110                                     $productImage = $_imagehelper->init($_product, $image)->resize($image_width, $image_height);
    111                                 $productImageUrl = $productImage->getUrl();
    112                             ?>
    113                                 <img class="product-image-photo default_image <?php if(!$_lazyload): ?>porto-lazyload<?php endif;?>" <?php if(!$_lazyload): ?>data-<?php endif; ?>src="<?php echo $productImageUrl; ?>" width="<?php echo $image_width; ?>" height="<?php echo $image_height; ?>" alt="<?php //echo $productImage->getLabel();?>"/>
    114                             <?php if($_category_config['alternative_image']): ?>
    115                             <?php
    116                                 if($aspect_ratio)
    117                                     $productHoverImage = $_imagehelper->init($_product, $hover_image)->constrainOnly(FALSE)->keepAspectRatio(TRUE)->keepFrame(FALSE)->resize($image_width);
    118                                 else
    119                                     $productHoverImage = $_imagehelper->init($_product, $hover_image)->resize($image_width, $image_height);
    120                                 $productHoverImageUrl = $productHoverImage->getUrl();
    121                             ?>
    122                                 <?php if($productImageUrl != str_replace("/thumbnail/","/small_image/",$productHoverImageUrl)): ?>
    123                                 <img class="product-image-photo hover_image" src="<?php echo $productHoverImageUrl; ?>" alt="<?php //echo $productHoverImage->getLabel();?>"/>
    124                                 <?php endif; ?>
    125                             <?php endif; ?>
    126                             </a>
    127                             <?php
    128                                 $product_label = "";
    129                                 if($_product_label_config['sale_label']) {
    130                                     if ($percentage = $_portohelper->getPercentage($_product)) {
    131                                         if($_product_label_config['sale_label_percent']) {
    132                                             $product_label .= '<div class="product-label sale-label">'.$percentage.'%'.'</div>';
    133                                         } else {
    134                                             $product_label .= '<div class="product-label sale-label">'.$_product_label_config['sale_label_text'].'</div>';
    135                                         }
    136                                     }
    137                                 }
    138                                 if($_product_label_config['new_label']) {
    139                                     $now = date("Y-m-d");
    140                                     $newsFrom= substr($_product->getData('news_from_date')?$_product->getData('news_from_date'):'',0,10);
    141                                     $newsTo=  substr($_product->getData('news_to_date')?$_product->getData('news_to_date'):'',0,10);
    142 
    143                                     if ($newsTo != '' || $newsFrom != ''){
    144                                         if (($newsTo != '' && $newsFrom != '' && $now>=$newsFrom && $now<=$newsTo) || ($newsTo == '' && $now >=$newsFrom) || ($newsFrom == '' && $now<=$newsTo)) {
    145                                             $product_label .= '<div class="product-label new-label">'.$_product_label_config['new_label_text'].'</div>';
    146                                         }
    147                                     }
    148                                 }
    149                                 if($product_label)
    150                                     echo '<div class="product-labels">'.$product_label.'</div>';
    151                             ?>
    152                             <?php if($product_type == 3 || $product_type == 5 || $product_type == 6 || $product_type == 7 || $product_type == 8 || $product_type == 9 || $product_type == 11): ?>
    153                             <div class="product-item-inner">
    154                                 <div class="product actions product-item-actions">
    155                                     <div class="actions-primary">
    156                                         <?php if ($_product->isSaleable()): ?>
    157                                             <?php $postParams = $block->getAddToCartPostParams($_product); ?>
    158                                             <form data-role="tocart-form" action="<?php echo $postParams['action']; ?>" method="post">
    159                                                 <input type="hidden" name="product" value="<?php echo $postParams['data']['product']; ?>">
    160                                                 <input type="hidden" name="<?php echo Action::PARAM_NAME_URL_ENCODED; ?>" value="<?php echo $postParams['data'][Action::PARAM_NAME_URL_ENCODED]; ?>">
    161 
    162                                                 <?php echo $block->getBlockHtml('formkey')?>
    163                                                 <button type="submit"
    164                                                         title="<?php echo $block->escapeHtml(__('Add to Cart')); ?>"
    165                                                         class="action tocart primary">
    166                                                     <span><?php echo __('Add to Cart') ?></span>
    167                                                 </button>
    168                                             </form>
    169                                         <?php else: ?>
    170                                             <?php if ($_product->getIsSalable()): ?>
    171                                                 <div class="stock available"><span><?php echo __('In stock') ?></span></div>
    172                                             <?php else: ?>
    173                                                 <div class="stock unavailable"><span><?php echo __('Out of stock') ?></span></div>
    174                                             <?php endif; ?>
    175                                         <?php endif; ?>
    176                                     </div>
    177                                     <?php if ($block->getMode() == 'grid'): ?>
    178                                     <?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow()): ?>
    179                                         <a href="#"
    180                                            class="action towishlist actions-secondary"
    181                                            title="<?php echo $block->escapeHtml(__('Add to Wish List')); ?>"
    182                                            aria-label="<?php echo $block->escapeHtml(__('Add to Wish List')); ?>"
    183                                            data-post='<?php echo $block->getAddToWishlistParams($_product); ?>'
    184                                            data-action="add-to-wishlist"
    185                                            role="button">
    186                                             <span><?php echo __('Add to Wish List') ?></span>
    187                                         </a>
    188                                     <?php endif; ?>
    189                                     <?php endif; ?>
    190                                     <?php if($_category_config['addtocompare']): ?>
    191                                     <?php
    192                                     $compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare');
    193                                     ?>
    194                                     <a href="#"
    195                                        class="action tocompare actions-secondary"
    196                                        title="<?php echo $block->escapeHtml(__('Add to Compare')); ?>"
    197                                        aria-label="<?php echo $block->escapeHtml(__('Add to Compare')); ?>"
    198                                        data-post='<?php echo $compareHelper->getPostDataParams($_product); ?>'
    199                                        role="button">
    200                                         <span><?php echo __('Add to Compare') ?></span>
    201                                     </a>
    202                                     <?php endif; ?>
    203                                 </div>
    204                             </div>
    205                             <?php endif; ?>
    206                             <!-- Dailydeal Product data -->
    207                             <?php if($_dailydealhelper->isDealProduct($_product->getId())) : ?>
    208                             <?php $unique_id = $this->getData("name")."_".rtrim(base64_encode(md5(microtime())),"="); ?>
    209                             <input type="hidden" id="todate_<?php echo $unique_id; ?>" value="<?php echo $_dailydealhelper->getDailydealToDate($_product->getSku()); ?>" >
    210                             <input type="hidden" id="fromdate_<?php echo $unique_id; ?>" value="<?php echo $_dailydealhelper->getDailydealFromDate($_product->getSku()); ?>">
    211                             <div class="sw-dailydeal-wrapper" style="display:none;" data-unique-id="<?php echo $unique_id; ?>">
    212                                 <div class="sw-dailydeal">
    213                                     <p id="expired_<?php echo $unique_id; ?>"></p>
    214                                     <div class="countdowncontainer countdowncontainer_<?php echo $unique_id; ?>" style="display:none;">
    215                                         <span class="dailydeal-label">
    216                                             <?php echo __('Ends In:'); ?>
    217                                         </span>
    218                                         <span class="number-wrapper">
    219                                             <div class="line"></div>
    220                                             <span class="number day"><p id="countdown_days_<?php echo $unique_id; ?>">00</p></span>
    221                                             <div class="caption"><?php echo __('Day(s), '); ?></div>
    222                                         </span>
    223 
    224                                         <span class="number-wrapper">
    225                                             <div class="line"></div>
    226                                             <span class="number hour"><p id="countdown_hours_<?php echo $unique_id; ?>">00</p></span>
    227                                             <div class="caption">:</div>
    228                                         </span>
    229 
    230                                         <span class="number-wrapper">
    231                                             <div class="line"></div>
    232                                             <span class="number min"><p id="countdown_minutes_<?php echo $unique_id; ?>">00</p></span>
    233                                             <div class="caption">:</div>
    234                                         </span>
    235 
    236                                         <span class="number-wrapper">
    237                                             <div class="line"></div>
    238                                             <span class="number sec"><p id="countdown_seconds_<?php echo $unique_id; ?>">00</p></span>
    239                                             <div class="caption"></div>
    240                                         </span>
    241                                     </div>
    242                                 </div>
    243                             </div>
    244                             <?php endif; ?>
    245                             <!-- Dailydeal Product End -->
    246                         </div>
    247                         <div class="product details product-item-details">
    248                             <?php
    249                                 $_productNameStripped = $block->stripTags($_product->getName(), null, true);
    250                             ?>
    251                             <strong class="product name product-item-name">
    252                                 <a class="product-item-link"
    253                                    href="<?php echo $_product->getProductUrl() ?>">
    254                                     <?php echo $_helper->productAttribute($_product, $_product->getName(), 'name'); ?>
    255                                 </a>
    256                             </strong>
    257                             <?php //$_category_config['rating_star'] = "";  //disabled at the moment ?>
    258                             <?php if($_category_config['rating_star']): ?>
    259                             <?php
    260                                 $review_html = $block->getReviewsSummaryHtml($_product, $templateType);
    261                             ?>
    262                             <?php if($review_html): ?>
    263                                 <?php echo $block->getReviewsSummaryHtml($_product, $templateType); ?>
    264                             <?php else: ?>
    265                             <div class="product-reviews-summary short">
    266                                 <div class="rating-summary">
    267                                     <span class="label"><span>Rating:</span></span>
    268                                     <div class="rating-result" title="0%">
    269                                         <span style="width:0"><span>0%</span></span>
    270                                     </div>
    271                                 </div>
    272                             </div>
    273                             <?php endif; ?>
    274                             <?php endif; ?>
    275 
    276                             <?php if ($showDescription):?>
    277                                 <div class="product description product-item-description">
    278                                     <?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?>
    279                                     <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>"
    280                                        class="action more"><?php echo __('Learn More') ?></a>
    281                                 </div>
    282                             <?php endif; ?>
    283                             <?php if($_category_config['product_price']): ?>
    284                             <?php echo $block->getProductPrice($_product) ?>
    285                             <?php endif; ?>
    286                             <?php echo $block->getProductDetailsHtml($_product); ?>
    287 
    288                             <?php if($product_type != 3 && $product_type != 5 && $product_type != 6 && $product_type != 7 && $product_type != 8 && $product_type != 9 && $product_type != 11 && $product_type != 12): ?>
    289                             <div class="product-item-inner">
    290                                 <div class="product actions product-item-actions">
    291                                     <?php if ($block->getMode() == 'grid'): ?>
    292                                     <?php if($_category_config['addtowishlist'] && $product_type != 4): ?>
    293                                     <?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow()): ?>
    294                                         <a href="#"
    295                                            class="action towishlist actions-secondary"
    296                                            title="<?php echo $block->escapeHtml(__('Add to Wish List')); ?>"
    297                                            aria-label="<?php echo $block->escapeHtml(__('Add to Wish List')); ?>"
    298                                            data-post='<?php echo $block->getAddToWishlistParams($_product); ?>'
    299                                            data-action="add-to-wishlist"
    300                                            role="button">
    301                                             <span><?php echo __('Add to Wish List') ?></span>
    302                                         </a>
    303                                     <?php endif; ?>
    304                                     <?php endif; ?>
    305                                     <?php endif; ?>
    306                                     <div class="actions-primary">
    307                                         <?php if ($_product->isSaleable()): ?>
    308                                             <?php $postParams = $block->getAddToCartPostParams($_product); ?>
    309                                             <form data-role="tocart-form" action="<?php echo $postParams['action']; ?>" method="post">
    310                                                 <input type="hidden" name="product" value="<?php echo $postParams['data']['product']; ?>">
    311                                                 <input type="hidden" name="<?php echo Action::PARAM_NAME_URL_ENCODED; ?>" value="<?php echo $postParams['data'][Action::PARAM_NAME_URL_ENCODED]; ?>">
    312                                                 <?php if($product_type == 10):?>
    313                                                     <div class="qty-box">
    314                                                         <a href="javascript:void(0)" class="qtyminus"><i class="porto-icon-minus"></i></a>
    315                                                         <input type="text" name="qty" id="qty" maxlength="12" value="<?php echo ($this->getMinimalQty($_product)?$this->getMinimalQty($_product):1) ?>" title="<?php /* @escapeNotVerified */ echo __('Qty') ?>" class="input-text qty" data-validate="<?php echo $block->escapeHtml(json_encode($block->getQuantityValidators())) ?>"/>
    316                                                         <a href="javascript:void(0)" class="qtyplus"><i class="porto-icon-plus"></i></a>
    317                                                     </div>
    318                                                 <?php endif;?>
    319                                                 <?php echo $block->getBlockHtml('formkey')?>
    320                                                 <button type="submit"
    321                                                         title="<?php echo $block->escapeHtml(__('Add to Cart')); ?>"
    322                                                         class="action tocart primary">
    323                                                     <span><?php echo __('Add to Cart') ?></span>
    324                                                 </button>
    325                                             </form>
    326                                         <?php else: ?>
    327                                             <?php if ($_product->getIsSalable()): ?>
    328                                                 <div class="stock available"><span><?php echo __('In stock') ?></span></div>
    329                                             <?php else: ?>
    330                                                 <div class="stock unavailable"><span><?php echo __('Out of stock') ?></span></div>
    331                                             <?php endif; ?>
    332                                         <?php endif; ?>
    333                                     </div>
    334                                     <?php if ($block->getMode() == 'grid'): ?>
    335                                     <?php if($_category_config['addtowishlist'] && $product_type == 4): ?>
    336                                     <?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow()): ?>
    337                                         <a href="#"
    338                                            class="action towishlist actions-secondary"
    339                                            title="<?php echo $block->escapeHtml(__('Add to Wish List')); ?>"
    340                                            aria-label="<?php echo $block->escapeHtml(__('Add to Wish List')); ?>"
    341                                            data-post='<?php echo $block->getAddToWishlistParams($_product); ?>'
    342                                            data-action="add-to-wishlist"
    343                                            role="button">
    344                                             <span><?php echo __('Add to Wish List') ?></span>
    345                                         </a>
    346                                     <?php endif; ?>
    347                                     <?php endif; ?>
    348                                     <?php endif; ?>
    349                                     <?php if($_category_config['addtocompare']): ?>
    350                                     <?php
    351                                     $compareHelper = $this->helper('Magento\Catalog\Helper\Product\Compare');
    352                                     ?>
    353                                     <a href="#"
    354                                        class="action tocompare actions-secondary"
    355                                        title="<?php echo $block->escapeHtml(__('Add to Compare')); ?>"
    356                                        aria-label="<?php echo $block->escapeHtml(__('Add to Compare')); ?>"
    357                                        data-post='<?php echo $compareHelper->getPostDataParams($_product); ?>'
    358                                        role="button">
    359                                         <span><?php echo __('Add to Compare') ?></span>
    360                                     </a>
    361                                     <?php endif; ?>
    362                                 </div>
    363                             </div>
    364                             <?php endif; ?>
    365                         </div>
    366                     </div>
    367                     <?php echo($iterator == count($_productCollection)+1) ? '</div>' : '' ?>
    368                 <?php endforeach; ?>
    369             </div>
    370         </div>
    371         <script type="text/javascript">
    372           require([
    373             'jquery',
    374             'Smartwave_Filterproducts/js/owl.carousel/owl.carousel.min',
    375             'Smartwave_Filterproducts/js/lazyload/jquery.lazyload'
    376           ], function ($) {
    377             $("#porto-filter-products-<?= $id ?> .owl-carousel").owlCarousel({
    378               autoplay: <?php echo $enable_autoplay;?>,
    379               autoplayTimeout: 5000,
    380               autoplayHoverPause: true,
    381               loop: <?php echo $enable_slide_loop;?>,
    382               navRewind: true,
    383               lazyLoad:true,
    384               margin: 0,
    385               nav: <?php echo $show_slide_nav;?>,
    386               dots: <?php echo $show_slide_page;?>,
    387               responsive: {
    388                 0: {
    389                   items:<?php echo $mobile_slide_columns; ?>
    390                 },
    391                 640: {
    392                   items:<?php echo $mobile_slide_columns; ?>
    393                 },
    394                 768: {
    395                   items: <?php echo $tablet_slide_columns; ?>
    396                 },
    397                 992: {
    398                   items: <?php echo $tablet_slide_columns; ?>
    399                 },
    400                 1200: {
    401                   items: <?php echo $desktop_slide_columns; ?>
    402                 }
    403               }
    404             });
    405             $("img.porto-lazyload:not(.porto-lazyload-loaded)").lazyload({effect:"fadeIn", effect_speed: 400 });
    406             if ($('.porto-lazyload:not(.porto-lazyload-loaded)').closest('.owl-carousel').length) {
    407                 $('.porto-lazyload:not(.porto-lazyload-loaded)').closest('.owl-carousel').on('initialized.owl.carousel', function() {
    408                     $(this).find('.porto-lazyload:not(.porto-lazyload-loaded)').trigger('appear');
    409                 });
    410                 $('.porto-lazyload:not(.porto-lazyload-loaded)').closest('.owl-carousel').on('changed.owl.carousel', function() {
    411                     $(this).find('.porto-lazyload:not(.porto-lazyload-loaded)').trigger('appear');
    412                 });
    413             }
    414           });
    415         </script>
    416       </div>
    417     </div>
    418     <?php if (!$_dailydealhelper->isLoadedTimer()): ?>
    419     <script type="text/javascript">
    420     require([
    421         'jquery'
    422     ], function ($) {
    423     // Timer for LEFT time for Dailydeal product
    424         var _second = 1000;
    425         var _minute = _second * 60;
    426         var _hour = _minute * 60;
    427         var _day = _hour * 24;
    428         var timer;
    429 
    430         //Set date as magentodatetime
    431         var date = new Date('<?php echo $_dailydealhelper->getcurrentDate() ?>');
    432         var l_date = new Date();
    433         var offset_date = l_date - date;
    434 
    435         function showRemaining()
    436         {
    437             $(".sw-dailydeal-wrapper").each(function(){
    438                 var unique_id = $(this).attr("data-unique-id");
    439                 // get Value of dailydeal product
    440                 var cid='countdown_'+unique_id;
    441                 var daysid='countdown_days_'+unique_id;
    442                 var hoursid='countdown_hours_'+unique_id;
    443                 var minutesid='countdown_minutes_'+unique_id;
    444                 var secondsid='countdown_seconds_'+unique_id;
    445 
    446                 var startdateid='fromdate_'+unique_id;
    447                 var id='todate_'+unique_id;
    448 
    449                 var enddate = new Date($('#'+id).val());
    450                 var dealstartdate=new Date($('#'+startdateid).val());
    451 
    452                 var currentdate=new Date();
    453 
    454                 //Get Difference between Two dates
    455                 var distance = enddate - (currentdate - offset_date);
    456 
    457                 $('.sw-dailydeal-wrapper').show();
    458 
    459                 if (distance < 0) {
    460                    // clearInterval(timer);
    461                     $('#expired_'+unique_id).html("<span style='font-size:25px; color:#000;'>EXPIRED!<span>");
    462 
    463                 } else if(dealstartdate > currentdate) {
    464                    $('.countdowncontainer_'+unique_id).hide();
    465                    var msg="<span style='font-size:15px; color:#000;'> Coming Soon..<br>Deal Start at:<br>"+$('#'+startdateid).val()+"<span>";
    466                    $('#expired_'+unique_id).html(msg);
    467                 } else {
    468                     var days = Math.floor(distance / _day);
    469                     var hours = Math.floor((distance % _day) / _hour);
    470                     var minutes = Math.floor((distance % _hour) / _minute);
    471                     var seconds = Math.floor((distance % _minute) / _second);
    472 
    473                     if(hours < 10)
    474                         hours = "0" + hours;
    475                     if(minutes < 10)
    476                         minutes = "0" + minutes;
    477                     if(seconds < 10)
    478                         seconds = "0" + seconds;
    479                     $('.countdowncontainer_'+unique_id).show();
    480                     $('#'+daysid).html(days);
    481                     $('#'+hoursid).html(hours);
    482                     $('#'+minutesid).html(minutes);
    483                     $('#'+secondsid).html(seconds);
    484                 }
    485             });
    486         }
    487 
    488         // Set Interval
    489         timer = setInterval(function()
    490         {
    491             showRemaining();
    492         }, 1000);
    493     });
    494     </script>
    495     <?php $_dailydealhelper->setLoadedTimer(); ?>
    496     <?php endif; ?>
    497     <?php if (!$block->isRedirectToCartEnabled()) : ?>
    498         <script type="text/x-magento-init">
    499         {
    500             "[data-role=tocart-form], .form.map.checkout": {
    501                 "catalogAddToCart": {}
    502             }
    503         }
    504         </script>
    505     <?php endif; ?>
    506 <?php endif; ?>